package net.yihang.service;

import net.yihang.entity.Order;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OrderService {

    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public Order find(int id) {
        return sessionFactory.getCurrentSession().get(Order.class, id);
    }
}
